import ajaxAsync from 'vue-xiaobu-utils'
import FinanceInfoModel from '../models/FinanceInfoModel'

/**
 * 获取市民金融集成银行列表
 */
async function getFinanceList() {
  let body = await ajaxAsync('/user/oauth/finance/list', {})
  let list = body.LIST
  let convertList = []
  list.map(item => {
    // 组装银行数据模型
    convertList.push(new FinanceInfoModel(item))
  })
  return convertList
}

/**
 * 获取市民金融集成银行列表
 */
async function getFinanceCCB() {
  let body = await ajaxAsync('/user/oauth/finance/ccb', {})
  return body
}

export {
  getFinanceList,
  getFinanceCCB
}
